package com.friend.chat.db.entity


import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey

/**
 * @des
 * @author batie fancy
 * @date 2023/1/7
 */

@Entity(tableName = "table_message",indices = [Index(value = ["messageId"],
    unique = true)])
class MessageEntity:java.io.Serializable {
    @PrimaryKey(autoGenerate = true)
    var id :Int =0
    var roomId:String = ""
    var messageId: String = ""
    var userId: String = ""
    var toUid: String =""
    var type: Int= 1
    var roomType:Int =0
    var message: String = ""
    var dateTime: String = "2023-01-01 12:23:12"
    //下面仅群聊有
    var fromNickname:String?=""
    var fromHeader:String?=""
    /*override fun toString(): String {
        return "MessageEntity(id=$id, chatId =$roomId,messageId='$messageId', userId='$userId', toUid='$toUid', type=$type, message='$message', dateTime='$dateTime')"
    }*/


}